package com.android.fastride.present;

import android.os.Bundle;
import android.view.View;

import com.android.fastride.contract.RatingListContract;
import com.android.fastride.model.db.entity.Rating;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.peng.library.mantis.expand.list.MantisListPresent;

import java.util.ArrayList;

public class RatingListPresent extends MantisListPresent<RatingListContract.VIEW, Rating>
        implements RatingListContract
        .PRESENT {

    ArrayList<Rating> testDataList = new ArrayList<>();

    @Override
    public void onCreate(RatingListContract.VIEW view, Bundle data) {
        super.onCreate(view, data);
        for(int i=0; i<=20; i++) {
            testDataList.add(new Rating());
        }
    }

    @Override
    public void onCreateView(RatingListContract.VIEW view) {
        super.onCreateView(view);
        onRefreshCall();
    }

    @Override
    public void onItemClick(BaseQuickAdapter adapter, View view, int position) {

    }

    @Override
    public boolean onItemLongClick(BaseQuickAdapter adapter, View view, int position) {
        return false;
    }

    @Override
    public void onLoadMoreRequested() {

    }

    @Override
    public void onRefreshCall() {
        publishListData(testDataList);
        getAdapter().notifyDataSetChanged();
    }
}
